//
//  RPAlertNavigationController.m
//  RPCommonKit
//
//  Created by Deabel on 2023/11/6.
//

#import "RPAlertNavigationController.h"
#import "RPAlertTransitioningHandler.h"

@interface RPAlertNavigationController ()

@property (nonatomic, strong) RPAlertTransitioningHandler *transitioningHandler;
@end

@implementation RPAlertNavigationController

+ (instancetype)alertWithAlertViewController:(RPAlertController *)alertVc {
    RPAlertNavigationController *nav = [[RPAlertNavigationController alloc] initWithRootViewController:alertVc];
    nav.modalPresentationStyle = alertVc.modalPresentationStyle;
    
    nav.transitioningHandler = [[RPAlertTransitioningHandler alloc] init];
    nav.transitioningHandler.transitionAnimation = alertVc.transitionAnimation;
    nav.transitioningDelegate = nav.transitioningHandler;
    
    return nav;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

#pragma mark - RPAlertDelegate

- (UIViewController *)alertController {
    return self.viewControllers.firstObject;
}
@end
